<template>
    <a-date-picker :value="$Date(value)" @ok="handleOk" @change="handleOk" :placeholder="placeholder" :format="format" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" show-time />
</template>


<script setup lang="ts">
    import { $Date, $DateTimeStamp } from '@/tool/function';
    const emit = defineEmits(['change'])
    defineProps<{
        placeholder?: string,
        format?: {
            type: string,
            default: "YYYY-MM-DD HH:mm:ss"
        },
        value: number
    }>()
    const handleOk= (e: Date) => {
        emit("change", $DateTimeStamp(e))
    }
</script>
